<?php

use think\migration\Seeder;

class Base extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $data = [
            [
                'username' => 'admin',
                'password' => encrypt('123456789', 'admin'),
                'name'     => 'chenvle',
                'role_id'  => 1
            ]
        ];

        $posts = $this->table('user');
        $posts->insert($data)->saveData();


        $data = [
            [
                'name'     => '超级管理员',
            ]
        ];

        $posts = $this->table('role');
        $posts->insert($data)->saveData();

    }
}